package com.naizhuai.network.apistore;

import android.support.annotation.CheckResult;

import com.naizhuai.network.Config;
import com.naizhuai.network.entity.ResultResponse;
import com.naizhuai.ui.entity.CommonLabel;
import com.naizhuai.ui.entity.AddTaskPage;
import com.naizhuai.ui.entity.NormalQAPage;

import com.naizhuai.ui.entity.StepJoin;
import com.naizhuai.ui.entity.StepSettingBean;
import com.naizhuai.ui.entity.Task.AddTaskFlowPage;
import com.naizhuai.ui.entity.Task.FlowMethodDetial;
import com.naizhuai.ui.entity.Task.BehaviorRecommendation;
import com.naizhuai.ui.entity.Task.TaskChartData;
import com.naizhuai.ui.entity.TaskDetialEntity;

import com.naizhuai.ui.entity.TaskFlowMethod;
import com.naizhuai.ui.entity.TaskListBean;
import com.naizhuai.ui.entity.TempImgBean;
import com.naizhuai.ui.entity.UserLeader;

import java.util.List;
import java.util.Map;

import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 * @author：lichenxi
 * @date 2018/3/29 15
 * email：525603977@qq.com
 * Fighting
 */
public interface TaskActionApiRequest {
    //获取流程方法以及模板
    @GET(Config.GETTASKFLOW)
    Observable<ResultResponse<TaskFlowMethod>> getTaskFlowList();

    //获取公司标尺设置
    @GET(Config.ADDTASKPAGE)
    Observable<ResultResponse<AddTaskPage>> getAddTaskPage(@Query("companyId") String companyId, @Query("goalId")   String goalId);

    //添加任务

    @FormUrlEncoded
    @POST(Config.ADDTASK)
    @CheckResult
    Observable<ResultResponse<String>> AddTask(@FieldMap Map<String,String> personmap);


    @GET(Config.USER_LEADER)
    Observable<ResultResponse<List<UserLeader>>> USER_LEADER(@Query("goalId")String id);

    //任务列表
    @GET(Config.TASK_LIST)
    Observable<ResultResponse<TaskListBean>>TASK_LIST(@Query("companyId")String id);

    @GET(Config.TASK_DETIAL)
    Observable<ResultResponse<TaskDetialEntity>>task_detail(@Query("taskId")String taskId);

    //添加流程页面
    @GET(Config.ADD_TASK_FLOW_PAGE)
    Observable<ResultResponse<AddTaskFlowPage>> add_task_flow_page(@Query("taskId")String taskId, @Query("companyId")String companyId);

    //添加任务流程
    @FormUrlEncoded
    @POST(Config.ADD_TASK_FLOW)
    @CheckResult
    Observable<ResultResponse<String>>add_task_flow(@Field("taskId")String taskId, @Field("flowData")String flowData);

    @GET(Config.ASK_FLOW_METHOD_DETAIL)
    Observable<ResultResponse<List<FlowMethodDetial>>>task_flow_method_detail(@Query("methodId")String methodId);

    //环节负责人设置环节内容页面
    @GET(Config.leader_set_task_flow_page)
    Observable<ResultResponse<StepSettingBean>> leader_set_task_flow_page(@Query("taskFlowId")String taskFlowId);

    //环节负责人设置环节内容
    @FormUrlEncoded
    @POST(Config.leader_set_task_flow)
    @CheckResult
    Observable<ResultResponse<String>> leader_set_task_flow(@Field("taskFlowId")String taskFlowId,
                                                            @Field("imageUrl")String imageUrl,
                                                            @Field("detail")String detail,
                                                            @Field("stepName")String stepName,
                                                            @Field("circleType")String circleType);

    //环节参与页面
    @GET(Config.task_flow_joined)
    Observable<ResultResponse<StepJoin>>  task_flow_joined(@Query("taskFlowId")String taskFlowId);

    //添加问题的页面
    @GET(Config.normal_question_page)
    Observable<ResultResponse<NormalQAPage>> normal_question_page(@Query("questionId")String questionId,
                                                                   @Query("schemeId")String schemeId);

    //环节负责人设置环节内容
    @FormUrlEncoded
    @POST(Config.add_normal_question)
    @CheckResult
    Observable<ResultResponse<String>>  add_normal_question(@FieldMap Map<String,String> questionmap);

    //接受问题
    @FormUrlEncoded
    @POST(Config.RECEIVE_QUESTION)
    @CheckResult
    Observable<ResultResponse<String>>  receive_question(@Field("questionId")String questionId,@Field("descLabel")String descLabel,@Field("schemeId")String schemeId);

    //获取子类标签
    @GET(Config.sub_label_list)
    Observable<ResultResponse<List<CommonLabel>>> sub_label_list(@Query("labelId")String labelId);

    //根据标签和问题搜索
    @GET(Config.label_question_search)
    Observable<ResultResponse<List<BehaviorRecommendation>>> label_question_search(@Query("title")String title, @Query("labels")String labels);

    //临时图片的方案
    @GET("company/common/get-scheme-image")
    Observable<ResultResponse<TempImgBean>> get_scheme_image(@Query("schemeId")String schemeId);


    @GET(Config.TASK_CHART_DATA_PAGE)
    Observable<ResultResponse<List<TaskChartData>>> task_chart_data_page(@Query("taskId")String taskId);

    @POST(Config.ADD_TASK_CHART_DATA)
    @FormUrlEncoded
    Observable<ResultResponse<String>> add_task_data_page(@Field("taskId")String taskId,@Field("chartData")String chartData);
}

